<script type="text/javascript">
var successFun=function(res){
if(res.code==200){
	document.location	= res.data.forward;
}else{
	alert('出错了，请重新尝试！');
}
}
$(document).ready(function() { 
	var updateOptions	= {dataType:'json',error:doError,success:doSuccess}
    $('#form').ajaxForm(updateOptions); 
}); 
</script>
<div id="content">
<form id="form" action="{url('Post','SaveEdit')}" method="post">
<h3 class="title">{if $this->data['id']>0}修改{else}添加{/if}帖子</h3>
<table class="admin-table">
<tr>
	<td><label for="title">标题：</label></td>
	<td>
	<input name="title" id="title" type="text" size="50" {if $this->data['info']}value="{$this->data['info']['title']}"{/if} /><span etype='error_info' class="error_info"id="title_info"></span>
	</td>
</tr>
<tr>
	<td><label for="txtcontent">内容：</label></td>
	<td>
	<textarea name="content#content" id="txtcontent" style="width:500px;height:300px">
	{if $this->data['info']}{$this->data['info']['content']['content']}{/if}
	</textarea>
	<span etype='error_info' class="error_info" id="content#content_info"></span>
	</td>
</tr>
<tr>
	<td><label for="visit_num">浏览次数：</label></td>
	<td>
	<input name="visit_num" id="visit_num" type="text" {if $this->data['info']}value="{$this->data['info']['visit_num']}"{/if} /><span etype='error_info' class="error_info" id="visit_num_info"></span>
	</td>
</tr>
<tr>
	<td><label for="title">标签：</label></td>
	<td>
	<input name="tag" id="tag" type="text" size="50" {if $this->data['info']}value="{$this->data['info']['tag']}"{/if} /><span etype='error_info' class="error_info" id="tag_info">多个标签之间用，分隔，最多填写五个标签</span>
	</td>
</tr>
<tr>
	<td></td>
	<td>
	<input id="btnAjaxSubmit" type="submit" value="保存" />&nbsp;&nbsp;<input  type="button" value="返回" onclick="history.back()" />
	<input name="id" type="hidden" value="{$this->data['id']}" />
	</td>
</tr>
</table>
</div>
<script src="{$this->data['baseurl']}js/editor/kindeditor/kindeditor.js"></script>
<script>
KE.show({
id : 'txtcontent',
allowUpload : false
});
</script>